package com.carhome.utils;

import android.content.Context;
import android.content.SharedPreferences;

public class HttpJsonCache {
	private Context context;

	public HttpJsonCache(Context context) {
		this.context = context;
	}

	public void savaJsonCache(String url, String json) {
		SharedPreferences share = context.getSharedPreferences("httpCacheJson",
				Context.MODE_PRIVATE);
		share.edit().putString(url, json).commit();
	}

	public String getJsonCache(String url) {
		SharedPreferences share = context.getSharedPreferences("httpCacheJson",
				Context.MODE_PRIVATE);
		String json = share.getString(url, null);
		return json;
	}

}
